<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>圣杯布局</title>
    <style>
      * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
      }
      ul,
      ol {
        list-style: none;
      }
      body {
        display: flex;
        flex-direction: column;
        gap: 1px;
        min-height: 100vh;
        color: #ec9034;
        background: #ec9034;
      }
      header,
      aside,
      article,
      footer {
        background: white;
      }
      main {
        flex: 1 1 0%;
        min-height: 0;

        display: flex;
        gap: 1px;
      }
      aside {
        min-width: 220px;
        max-width: 320px;
      }
      aside:nth-of-type(1) {
        order: -1;
      }
      article {
        flex: 1 1 0%;
        min-width: 0;
      }
      header {
        padding: 8px 24px;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        text-transform: uppercase;
      }
      header ul,
      footer ul {
        display: inline-flex;
        gap: 16px;
      }
      footer {
        text-align: center;
      }

      @media screen and (max-width: 1000px) {
        main {
          flex-direction: column;
        }
        aside:nth-of-type(1) {
          order: 0;
        }
        aside {
          width: 100%;
          max-width: none !important;
        }
      }
    </style>
  </head>
  <body>
    <header>
      <h1>w3cplus</h1>
      <ul>
        <li>home</li>
        <li>about</li>
        <li>contact</li>
      </ul>
    </header>
    <main>
      <article>
        <h2>现代Web布局</h2>
        <p>使用CSS的FlexBox技术构建圣杯布局!</p>
      </article>
      <aside>左侧边栏</aside>
      <aside>右侧边栏</aside>
    </main>
    <footer>
      <ul>
        <li>home</li>
        <li>about</li>
        <li>contact</li>
      </ul>
    </footer>
  </body>
</html>
